package org.tgcloud.group.core;

import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Created by Administrator on 2015/8/4.
 */
public class BaseLogger {
    public Logger logger = LoggerFactory.getLogger(this.getClass());
    public static Logger staticLogger = LoggerFactory.getLogger(BaseLogger.class);

    /**
     * @Author SGY
     * @Date 2020/1/6 12:07
     * @Param
     * @return
     * @Description // 用于打印错误信息日志
     **/
    public static void printErrorInfo(Exception e) {
        staticLogger.error(e.toString());
        Map<String,Object> params = Maps.newHashMap();
        StringBuilder sb = new StringBuilder("");
        StackTraceElement[] elements = e.getStackTrace();
        for (int i = 0; i < elements.length ; i++)
        {
            staticLogger.error(elements[i].toString());
        }
    }
}
